package com.myplaylist.android.persistence;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class MyPlaylistSQLiteHelper extends SQLiteOpenHelper {
	
	

	private static final String DATABASE_NAME = "MyPlaylistAndroidDB";
	private static final int DATABASE_VERSION = 1;
	public static final String TABLE_TRACKS = "tracks";
	public static final String COLUMN_TITLE = "title";
	public static final String COLUMN_ID = "id";
	public static final String COLUMN_AUTHOR = "author";
	public static final String COLUMN_NO_OF_PLAYBACKS = "noOfPlaybacks";
	private static final String DATABASE_CREATE = "create table " + TABLE_TRACKS + "(" + COLUMN_ID + " integer primary key autoincrement, " + COLUMN_TITLE + " text not null, " + COLUMN_AUTHOR + " text not null, " + COLUMN_NO_OF_PLAYBACKS + " integer not null" + ")";

	public MyPlaylistSQLiteHelper(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
	}
	
	@Override
	public void onCreate(SQLiteDatabase arg0) {
		arg0.execSQL(DATABASE_CREATE);
	}

	@Override
	public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) {
		// TODO Auto-generated method stub

	}

}
